<!DOCTYPE html>
<html>
<head>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/mytags.jsp"%>
<title>分配催收人员</title>
<t:base type="autocomplete,my97,easyui,lhgdialog"></t:base>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- extend -->
<script type="text/javascript">
//初始化对话框
var api, W;
api = frameElement.api;
W = api.opener;
var id = api.data['id'];

//初始化调查人
var initAutoComplete = function(){

	$('#loanCollectionName').extraAutoComplete({
		 afterSelectedHandler: function(data){//选择数据之后的回调函数
		  $('#loanCollection').val(data.id);
	    }
	});
	

};
//关闭事件
var canclePage = function() {
	window.parent.frames.fnDraw();
	api.close();
};

$(function(){
	initAutoComplete();
	$('input[name="save_button"]').click(function(){
		$.ajax({
 		   	url:'sys/LoanExt/updateCollectionExt',
		    	data:{id:id,collectionAllotStatus:2,loanCollection:$("#loanCollection").val(),loanCollectionName:$("#loanCollectionName").val()},
		    	type:'post',
		    	dataType:'json',
		    	success:function(result){
		    	        if(result.state == "200"){
		    	        	$.dialog.alert('催收分配成功！',function(){
		    	        		canclePage();
		    	        	},function(){
		    	        		canclePage();
		    	        	});
		    	        }else{
		    	        	$.dialog.alert('催收分配失败');
		    	        }
		    		}
		        });
	});
});
</script>
</head>

<body>
	<div class="place">
	    <span>位置：</span>
	    <ul class="placeul">
		    <li><a href="javascript:void(0)">首页</a></li>
		    <li><a href="javascript:void(0)">贷款管理</a></li>
		    <li><a href="javascript:void(0)">贷后管理</a></li>
		    <li><a href="javascript:void(0)">分配催收人员</a></li>
	    </ul>
    </div>
    
    <div class="formbody">
		    	<div class="formtitle"><span>分配催收人员</span></div>
		    	<div class="toolsli">
					<form id="_inspect_detail" name="_inspect_detail" enctype="multipart/form-data" method="post">
		    			<ul class="forminfo">
		   					<li>
		   						<kl class="kl_first">
									<label>催收人员<b>*</b></label>
									<input id="loanCollection" name="loanCollection" type="hidden"  class="newinput190 dfinput easyui-validatebox"/>&nbsp;&nbsp;
									<input id="loanCollectionName" name="loanCollectionName" type="text"  class="newinput190 easyui-validatebox"/>&nbsp;&nbsp;  
								</kl>
		   					</li>
					    	<li style="text-align: center"><input name="save_button" type="button" class="scbtn" value="保存"/></li>
		  	 			</ul>
		   			</form>
			    </div>
			    
		    </div>


</body>
</html>
